package com.insight.common.system.api;

import com.alibaba.fastjson.JSONObject;
import com.insight.common.system.vo.LoginUser;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface CommonListenerService {

    void updateQuestionByProcessInstanceId(String processInstanceId, Object serviceRequestSolution);

    void handlerAssets(String temProcessInstanceId, String option, String processInstanceId);

    void handlerFieldByKey(String processInstanceId, Map<String, Object> variables, String[] keys, String status) throws IllegalAccessException;

    void updateAssetsDelFlagByTempId(String tempProcessInstanceId);

    void saveQuestion(Map<String, Object> variables);

    void deleteAll(String processInstanceId);

    void deleteWorkOrder(String processInstanceId);

    void updateSlaTakeTimeByTask(Object taskEntity);

    Object getExtensionElements(String processDefinitionId, String taskDefinitionKey);

    String getSlaTypeByElement(Object property);

    HashMap<String, Object> getDueDataByLevelId(String level, String slaLevelId, Date taskCreateTime);

    void updateWorkOrderProcessDuration(String processInstanceId, Long durationInMillis);

    String getRejectNextUserByUserId(String processInstanceId,String userId);

    void addRejectTaskRecord(String taskId, String processInstanceId, String userId);


    long getRejectCountByUser(String username);

    List<String> getServiceProviderUsers();

    void userSetServiceProviderByUserNames(List<LoginUser> loginUsers);

    List<String> checkUserIsProvider(String username);

    String getServiceProviderByUser(String engineerId);

    void addServiceProviderUser(String serviceProviderUser, String username, double priority);

    void updateServiceProviderUser(String serviceProviderUser, String username, double priority);

    void deleteServiceProviderUser(String serviceProviderUser,String username);

    void deleteServiceProviderUsers(String serviceProviderUser, List<String> idsList);

    String getAssignNextNodeByProcessInstanceId(String userUnit,String processInstanceId);

     String getProviderCodeByUser(String engineerId);

    void addTaskTimeOut(String taskId, String user, String userUnit);

    HashMap<String, Object> getUserByTaskIdAndUser(String taskId, String assignee, String userUnit);

    String getOriginallyUserByTransfer(String taskId);

    void delTaskTimeOut(String taskId);

    void addWorkOrderProcess(JSONObject workOrderProcess, String expressionText, Map<String, Object> variables);

    void updateWorkOrderProcess(JSONObject workOrderProcess, String type, Date dueDate);

}
